﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LibraryO2S;

public partial class Administrator_Logoes : System.Web.UI.Page
{
    Logoes logo = new Logoes();
    protected void Page_Load(object sender, EventArgs e)
    {
        GetData();
        if (rptData.Items.Count < 1)
        {
            divMessage.InnerHtml = LibraryO2S.O2S_Message.Warning("Hệ thống", "Chưa có dữ liệu trong mục này");
        }

    }


    public void GetData()
    {
        try
        {
            rptData.DataSource = logo.LoadData(1);
            rptData.DataBind();
        }
        catch (Exception)
        {

            throw;
        }
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        try
        {

            string del_list = hdfCheck.Value;
            string[] sp_list = del_list.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < sp_list.Length; i++)
            {
                logo.tblLogoesDelete(int.Parse(sp_list[i]));
            }
            GetData();
        }
        catch (Exception ex)
        {

            divMessage.InnerHtml = O2S_Message.Error("Cảnh Báo", "Phát hiện lỗi! " + ex.Message);
        }

    }
    protected void btnAdnew1_Click(object sender, EventArgs e)
    {

        Response.Redirect("LogoAdd.aspx");
    }
}